package com.grf.function.controller;

import com.grf.function.service.SpecialService;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @description: 自定义控制类
 * @author: guorf
 * @date: 2024/8/19 23:21
 * @version: v1.0
 */
@Slf4j
@RestController
@RequestMapping("/special")
@RequiredArgsConstructor
public class SpecialController {

    private final SpecialService specialService;

    /**
     * @description: 供应商
     * @author: grf
     * @date: 2024/8/22
     */
    @GetMapping("/supplier")
    public void supplier(){
        specialService.supplier(() -> "test");
    }

    /**
     * @description: 消费性
     * @author: grf
     * @date: 2024/8/22
     */
    @GetMapping("/consumer")
    public void consumer(){
        specialService.consumer(arg -> System.out.println(arg+" world"));
    }

    /**
     * @description: 断定型
     * @author: grf
     * @date: 2024/8/22
     */
    @GetMapping("/predicate")
    public void predicate(){
        specialService.predicat(param -> param.equals("bbb"));
    }
}
